import e
import botpy
from botpy.types.message import Message


class dirtmesg2:
    trigger_keywords = "test2"

    def priority(self):  # 优先级
        return 2

    def should_trigger(self, message: Message, event):
        # 判断是否触发插件逻辑的条件
        result = False  # 初始化结果变量
        if hasattr(message, 'content'):
            if not message.content is None:
                result = message.content == self.trigger_keywords and event == 0
            else:
                result = False and event == 0
        return result

    async def execute(self, message: Message, api, event):
        await e.sendUser(api, message.guild_id, message.author.id, event, "test2 from directmsg2")
        return False
